import string


def count_words():
    # 获取用户输入
    sentence = input("请输入一个英文句子: ")

    # 将句子转换为小写
    sentence = sentence.lower()

    # 移除标点符号
    translator = str.maketrans('', '', string.punctuation)
    sentence = sentence.translate(translator)

    # 分割成单词列表
    words = sentence.split()

    # 创建一个空字典来存储单词计数
    word_count = {}

    # 统计每个单词的出现次数
    for word in words:
        if word in word_count:
            word_count[word] += 1
        else:
            word_count[word] = 1

    # 显示结果
    print("\n单词统计结果:")
    for word, count in word_count.items():
        print(f"{word}: {count} 次")


# 运行程序
count_words()